﻿Imports DAO
Imports DTO
Public Class HangHoaBUS

    Public Shared Function LoadBangHoangHoa() As DataTable
        Return HangHoaDAO.LoadBangHangHoa()
    End Function

    Public Shared Function LayDSLoaiHHCbx() As DataTable
        Return HangHoaDAO.LayDSLoaiHHCbx()
    End Function

    Public Shared Function LayDSHangHoa() As DataTable
        Return HangHoaDAO.LayDSHangHoa()
    End Function

    Public Shared Function ThemHangHoa(hh As HangHoaDTO) As Boolean
        Dim kt As Boolean = True
        If hh.TenHangHoa.Length = 0 Or hh.DiaChiAnh.Length = 0 Then
            Return False
        End If
        HangHoaDAO.ThemHangHoa(hh)
        Return kt
    End Function

    Public Shared Function CapNhatHangHoa(hh As HangHoaDTO) As Boolean
        Dim kt As Boolean = True
        If hh.TenHangHoa.Length = 0 Then
            Return False
        End If
        HangHoaDAO.CapNhatHangHoa(hh)
        Return kt
    End Function

    Public Shared Function XoaHangHoa(hh As HangHoaDTO) As Boolean
        Dim kt As Boolean = True
        HangHoaDAO.XoaHangHoa(hh)
        Return kt
    End Function

    Public Shared Sub LayMaHangHoaCbx(ByVal mahh As String, ByVal lhh As Integer, ByVal kmd As String, ByVal nh As String, ByVal dv As String, ByVal ncc As String)
        HangHoaDAO.LayMaHangHoaCbx(mahh, lhh, kmd, nh, dv, ncc)
    End Sub

End Class
